package controller;

import data.DatabaseConnection;
import data.Login;

import java.sql.Connection;

public class Login_c {
    public static boolean login(String username,String password){
        Connection con = null;
        try {
            con = new DatabaseConnection().connection();
        } catch (Exception e) {
            e.printStackTrace();
            return false;
        }
        try {
            if(new Login().login(con, username, password))
                con.close();
                return true;
        } catch (Exception e) {
            e.printStackTrace();
        }
        return false;
    }
}
